package org.computate.model.item;

import java.util.Date;

import com.googlecode.objectify.annotation.Cached;
import com.googlecode.objectify.annotation.Subclass;

@Cached
@Subclass
public class BuriedPerson extends Model {
	
	public String getModelDisplayName() { return "Buried Person"; }
	public String getModelPluralName() { return "Buried People"; }
	
	private String givenName;
	private String familyName;
	private Date born;
	private Date died;
	
	@Override
	public String getName() {
		return new StringBuilder(givenName).append(" ").append(familyName).toString();
	}
	
	public BuriedPerson() {
		super();
		setPhotosPermitted(true);
		setOrder("givenName");
	}
	
	@Override
	public void addFields() {
		super.addFields();
		removeField("name");
		addField("givenName", "Given Name");
		addField("familyName", "Family Name");
		addField("born", "Birth Date");
		addField("died", "Death Date");
	}
	
	public Date getBorn() {
		return born;
	}
	public void setBorn(Date born) {
		this.born = born;
	}
	public Date getDied() {
		return died;
	}
	public void setDied(Date died) {
		this.died = died;
	}
	public String getGivenName() {
		return givenName;
	}
	public void setGivenName(String givenName) {
		this.givenName = givenName;
	}
	public String getFamilyName() {
		return familyName;
	}
	public void setFamilyName(String familyName) {
		this.familyName = familyName;
	}
}
